<html>
<head>
  <title>Ajax with jQuery Example</title>
  <script src="http://code.jquery.com/jquery-1.10.1.min.js"></script> 
  <script type="text/JavaScript">
  var jsonUrl = "/buttons.json";  
  $(document).ready(function(){
    $("#generate").click(function(){
	$.getJSON(  
                jsonUrl,  
                function(json) {  
					alert(json.foo)
					alert(json.bar)
                }
			)
    });
  });
  </script>

</head>
<body>
<h2>jQuery and AJAX</h2>
  
    <p id="p1">This is some text in a paragraph.</p>
    <input type="submit" id="generate" value="Generate!">
 
</body>
</html>